﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="connection.aspx.vb" Inherits="connection1" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data.OleDb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Data Connection</title>
</head>
<body>
    <script type="text/VB">
        'Dim filename As String = "D:/Program/EC/eCSS - Version 01-080420/eCSS - Version 01/App_Data/practise01.mdb"
        'Using Sql server 2000 or 2005
        Dim strConnect As String = "Data Source = INTEL\SQLEXPRESS; Database= eCommerce;Integrated Security=SSPI;"
       
        'Using access
        'Dim strCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
        Dim cn As New SqlConnection(strConnect)
        cn.Open()
        Dim cmd As New SqlCommand("select Uong from bang1 where An='006'", cn)
        Dim strTest As String
        strTest = cmd.ExecuteScalar()
        cn.Close()
        Response.Write(strTest)
        </script>
   <br />How about that?<br />
</body>
</html>
